package com.example.SpringBootMybatis.controller;

import com.example.SpringBootMybatis.common.Result;
import com.example.SpringBootMybatis.entity.Disease;
import com.example.SpringBootMybatis.entity.Params;
import com.example.SpringBootMybatis.service.DiseaseService;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/about")
public class DiseaseController {

    @Resource
    private DiseaseService diseaseService;

    @GetMapping("/search")
    public Result findBySearch(Params params){
        PageInfo<Disease> info=diseaseService.findBySearch(params);
        return Result.success(info);
    }
}
